#ifndef KEYBOARDMANAGER_H_
#define KEYBOARDMANAGER_H_

#include <SDL.h>
#include <list>
#include <map>

#include "KeyboardEvent.h"

namespace Lame3d
{
	class KeyboardManager
	{
		public:
			KeyboardManager();
			~KeyboardManager();
			
			void RegisterCallback(KeyboardCallback *kc);
			void RegisterCallback(KeyboardCallback &kc);
			
			void BindCallback(const KeyEvent &e, const std::string &callbackName);
			void UnbindCallback(const std::string &callback);
			void UnbindKey(const KeyEvent &e);
			
			std::map<KeyEvent, KeyboardCallback*>::const_iterator BindingsIterator() const;
			std::map<std::string, KeyboardCallback*>::const_iterator CallbackIterator() const;
			
			void Handle(std::list<KeyEvent*> &events);
			void Handle(KeyEvent &e);
			
		protected:
			std::map<KeyEvent, KeyboardCallback*> bindings;
			std::map<std::string, KeyboardCallback*> callbacks;
	};
}

#endif /*KEYBOARDMANAGER_H_*/
